<?php


namespace App\Common;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;

class CommonServiceProvider extends ServiceProvider
{

    public function register()
    {
        $this->registerRoute();
    }

    public function registerRoute()
    {
        Route::prefix('common')
            ->middleware(['api'])
            ->namespace('App\Common\Http\Controller')
            ->group(function () {
                $files = glob(app_path("Common/Routes") . '/*.php');
                foreach ($files as $file) {
                    require $file;
                }
            });
    }
}
